<?php
/**
 * Author: Administrator
 * Date: 2022/7/15 1:29
 */

namespace DesignPatterns\Creation\AbstractFactory\Html;


use DesignPatterns\Creation\AbstractFactory\MediaInterface;

class Picture implements MediaInterface
{
    protected $src;
    protected $name;

    public function __construct($src, $alt)
    {
        $this->src = $src;
        $this->name = $alt;
    }

    public function render() {
        return sprintf('<img src="%s" alt="%s" />', $this->src, $this->name);
    }

}